<template>
  <div>
    <div class="time">
      <span>天天特价</span>
      <van-count-down :time="time">
        <template #default="timeData">
          <span class="block">{{
            timeData.hours < 10 ? "0" + timeData.hours : timeData.hours
          }}</span>
          <span class="colon">:</span>
          <span class="block">{{ timeData.minutes }}</span>
          <span class="colon">:</span>
          <span class="block">{{
            timeData.seconds < 10 ? "0" + timeData.seconds : timeData.seconds
          }}</span>
        </template>
      </van-count-down>
    </div>
    <div class="merchandise">
      <img
        src="../assets/Snipaste_2021-04-21_16-48-14.png"
        alt=""
        class="special_offer"
      >
    </div>
    <p>{{ text }}</p>
    <div class="price">
      <span>￥</span>
      <h3>10</h3>
      <del class="original">￥17</del>
      <div class="discount">5.88折</div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      time: 3 * 60 * 60 * 1000,
      text: '咸奶酪金莎厚奶茶'
    }
  }
}
</script>

<style lang="scss" scoped>
.time {
  display: flex;
  margin-top: 10px;

  align-items: center;
  justify-content: space-between;
  span {
    font-size: 14px;
    font-weight: 700;
  }

  .colon {
    display: inline-block;
    margin: 0 4px;
    color: #ee0a24;
  }
  .block {
    display: inline-block;
    width: 18px;
    color: #fff;
    font-size: 10px;
    text-align: center;
    border-radius: 5px;
    background-color: #ee0a24;
  }
}
.merchandise {
  margin-top: 10px;
  width: 100%;
  .special_offer {
    width: 100%;
    height: 90px;
    border-radius: 8px;
    background-color: #209bec;
  }
}
p {
  font-size: 14px;
  color: #777473;
  margin-top: 5px;
}
.price {
  margin-top: 10px;
  display: flex;
  span {
    margin-top: 4px;
    font-size: 8px;
    color: #e94a41;
    font-weight: 700;
  }
  h3 {
    color: #e94a41;
    font-weight: 700;
  }
  .original {
    color: #cfccca;
    margin-top: 4px;
    font-size: 12px;
  }
  .discount {
    border: 1px solid #ccc;
    font-size: 14px;
    color: #e38385;
    padding: 3px;
    font-weight: 700;
    margin-left: 10px;
    border-radius: 3px;
  }
}
</style>
